﻿@model Entities.Measure
@{
    ViewBag.Title = "Добавить мероприятие";
}

<h2>
    Добавление мероприятия для отработки риска "@ViewBag.RiskTitle" проекта "@ViewBag.ProjectTitle"</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-1.5.1.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.ui.core.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.ui.datepicker.js")" type="text/javascript"></script>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Новое мероприятие</legend>
        <div class="editor-label" style="display: none">
            @Html.LabelFor(model => model.ProjectRiskId)
        </div>
        <div class="editor-field" style="display: none">
            @Html.EditorFor(model => model.ProjectRiskId)
            @Html.ValidationMessageFor(model => model.ProjectRiskId)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Person.LastName)
        </div>
        @Html.DropDownListFor(model => model.PersonId, new SelectList(ViewBag.Persons, "PersonId", "LastName"))
        <div class="editor-label">
            @Html.LabelFor(model => model.Title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Title)
            @Html.ValidationMessageFor(model => model.Title)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.ReqBegDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ReqBegDate)
            @Html.ValidationMessageFor(model => model.ReqBegDate)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.ReqEndDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ReqEndDate)
            @Html.ValidationMessageFor(model => model.ReqEndDate)
        </div>
        <div class="editor-label" style="display: none">
            @Html.LabelFor(model => model.BegDate)
        </div>
        <div class="editor-field" style="display: none">
            @Html.EditorFor(model => model.BegDate)
            @Html.ValidationMessageFor(model => model.BegDate)
        </div>
        <div class="editor-label" style="display: none">
            @Html.LabelFor(model => model.EndDate)
        </div>
        <div class="editor-field" style="display: none">
            @Html.EditorFor(model => model.EndDate)
            @Html.ValidationMessageFor(model => model.EndDate)
        </div>
        <div class="editor-label" style="display: none">
            @Html.LabelFor(model => model.ReportFileName)
        </div>
        <div class="editor-field" style="display: none">
            @Html.EditorFor(model => model.ReportFileName)
            @Html.ValidationMessageFor(model => model.ReportFileName)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Comment)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Comment)
            @Html.ValidationMessageFor(model => model.Comment)
        </div>
        <p>
            <input type="submit" value="Добавить" />
        </p>
    </fieldset>
}
    
<script type="text/javascript">
    $("#ReqBegDate").datepicker({
        showOn: 'button',
        buttonImage: '/Content/images/calendar.png',
        duration: 0
    });
</script>

<script type="text/javascript">
    $("#ReqEndDate").datepicker({
        showOn: 'button',
        buttonImage: '/Content/images/calendar.png',
        duration: 0
    });
</script>

<div>
    @Html.ActionLink("К текущему риску", "ViewDetails", "Risk", new { id = Model.ProjectRiskId }, null)
</div>
